package com.fjec.gateway;

import com.alibaba.csp.sentinel.adapter.gateway.zuul.fallback.ZuulBlockFallbackManager;
import com.fjec.gateway.listener.AppStartedListener;
import com.fjec.gateway.sentinel.MyBlockFallbackProvider;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;

@Slf4j
@EnableZuulProxy
@SpringBootApplication(
        scanBasePackages = {"com.fjec.common", "com.fjec.gateway"},
        exclude = {RabbitAutoConfiguration.class}
)
@EnableDiscoveryClient
@EnableAsync
@EnableAspectJAutoProxy(exposeProxy = true, proxyTargetClass = true)
public class AppZuul {

    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(AppZuul.class);
        app.addListeners(AppStartedListener.INSTNACE);
        app.run(args);
    }
}
